home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / dev.fmt / mouse.man < prev    next >
Encoding:
Text File  |  1989-06-26  |  4.3 KB  |  135 lines

  1.  
  2.  
  3.  
  4. MOUSE                        Devices                        MOUSE
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      mouse - Devices used to read mouse and keyboard  events  for
  12.      window systems
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ddeevv//mmoouussee..hh>>
  16.  
  17. _________________________________________________________________
  18.  
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      Mouse devices are used by window systems to communicate with
  22.      the  raw  keyboard  and  mouse.   Each rreeaadd kernel call on a
  23.      mouse device returns one or more structures of the following
  24.      format:
  25.  
  26.           typedef struct {
  27.               int flags;
  28.               int key;
  29.               int deltaX;
  30.               int deltaY;
  31.               unsigned int time;
  32.           } Mouse_Event;
  33.      The buffer specified to a rreeaadd kernel  call  must  be  large
  34.      enough to hold at least one MMoouussee__EEvveenntt.  The _f_l_a_g_s field is
  35.      an OR-ed combination of the following bit masks:
  36.  
  37.      MMOOUUSSEE__EEVVEENNTT              Means  that  a  mouse  button   was
  38.                               pressed  or  released, or the mouse
  39.                               moved.
  40.  
  41.      KKEEYYBBOOAARRDD__EEVVEENNTT           Means that a  key  was  pressed  or
  42.                               released on the keyboard.  Only one
  43.                               of  MMOOUUSSEE__EEVVEENNTT  or  KKEEYYBBOOAARRDD__EEVVEENNTT
  44.                               will   be  set  in  any  particular
  45.                               event.
  46.  
  47.      KKEEYY__UUPP                   This bit is only relevant for  key-
  48.                               board  events.   If set, it implies
  49.                               that the key was released;   other-
  50.                               wise, the key was pressed.
  51.  
  52.      For mouse events, the _k_e_y field contains a bit mask indicat-
  53.      ing which mouse buttons are currently depressed.  The _d_e_l_t_a_X
  54.      and _d_e_l_t_a_Y fields indicate how much the mouse has moved  (in
  55.      pixels)  since the last mouse-related event.  The _t_i_m_e field
  56.      gives the value of a free-running millisecond clock  at  the
  57.      time  the  event  occurred.   The _t_i_m_e value has no absolute
  58.      significance, but is useful in  comparing  times  from  dif-
  59.      ferent events.
  60.  
  61.      For keyboard events, the _k_e_y field gives the number of a key
  62.  
  63.  
  64.  
  65. Sprite v.1.0         Printed:  June 25, 1989                    1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. MOUSE                        Devices                        MOUSE
  73.  
  74.  
  75.  
  76.      on the keyboard.  The numbers are keyboard-specific, and are
  77.      usually different than the ASCII values represented  by  the
  78.      keys.   The  KKEEYY__UUPP mask bit indicates whether the given key
  79.      just went up or down.  For ideal keyboards, such as those on
  80.      most Sun workstations, separate up and down events occur for
  81.      each key.  For  less-than-ideal  keyboards,  such  as  DEC's
  82.      LK201,  down  events  occur for all keys, but up events only
  83.      occur for a few keys such as shift.  The _d_e_l_t_a_X  and  _d_e_l_t_a_Y
  84.      fields have no significance for keyboard events, and _t_i_m_e is
  85.      the same as for mouse events.
  86.  
  87.      Writing to a mouse device has machine-specific effects.   On
  88.      Suns,  characters  written to a mouse device are transmitted
  89.      to the keyboard and perform the following special functions,
  90.      depending on the value of the character:
  91.  
  92.      KKBBDD__RREESSEETT ((11))            Reset the keyboard.
  93.  
  94.      KKBBDD__BBEELLLL__OONN ((22))          Turn on the bell.  It will stay  on
  95.                               until the KKBBDD__BBEELLLL__OOFFFF character is
  96.                               transmitted.
  97.  
  98.      KKBBDD__BBEELLLL__OOFFFF ((33))         Turn off the bell.
  99.  
  100.      KKBBDD__CCLLIICCKK__OONN ((1100))        Generate a click on each keystroke.
  101.  
  102.      KKBBDD__CCLLIICCKK__OOFFFF ((1111))       Stop clicking on each keystroke.
  103.  
  104.      No device-specific IO-control  operations  are  defined  for
  105.      mouse devices.
  106.  
  107.  
  108. KKEEYYWWOORRDDSS
  109.      event, keyboard, mouse, window system
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0         Printed:  June 25, 1989                    2
  132.  
  133.  
  134.  
  135.